#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdio>

using namespace std;

const int N = 1e5 + 10;

int a[N], n, w[N], m;

int main()
{
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);

    scanf("%d", &n);
    for(int i = 1; i <= n; i ++ )
        scanf("%d", &a[i]), w[a[i]] ++ , m = max(m, a[i]);

    int sum = 0, res = 0;
    for(int i = 1; i <= m; i ++ )
    {
        res += min(sum, w[i]);
        sum = max(0, sum - w[i]) + w[i];
    }
    cout << n - res << endl;

    return 0;
}
